/*
 * MMASpaceCube.java
 *
 * Created on September 20, 2004, 7:26 PM
 */

package edu.temple.GUS.MMA.DataTypes;

import java.util.ArrayList;
import edu.temple.GUS.MMA.Neighborhoods.XYZLag;
import edu.temple.GUS.MMA.misc.*;
import edu.temple.GUS.MMA.util.StatisticalOperator;

/**
 *
 * @author  jeffleon
 */
public class MMASpaceCube {
    
    // SpaceCube attributess
    private int x;
    private int y;
    private int z;
    private float xLL;
    private float yLL;
    private float zStart;
    private int xResolution;
    private int yResolution;
    private int zResolution;
    private float noData;   // No data value
    private float data[][][];

    /** Creates a new instance of MMASpaceCube */
    public MMASpaceCube() {}
    
    public MMASpaceCube(int x, int y, int z)
    {
        this.x = x;
        this.y = y;
        this.z = z;
    }
    
    public MMASpaceCube(int x, int y, int xResolution, int yResolution, int zResolution)
    {
        this.x = x;
        this.y = y;
        this.z = z;
        this.xResolution = xResolution;
        this.yResolution = yResolution;
        this.zResolution = zResolution;
    }

    public MMASpaceCube(int x, int y, int xResolution, int yResolution, int zResolution, float xLL, float yLL)
    {
        this.x = x;
        this.y = y;
        this.z = z;
        this.xLL = xLL;
        this.yLL = yLL;
        this.xResolution = xResolution;
        this.yResolution = yResolution;
        this.zResolution = zResolution;
    }
    
    public MMASpaceCube(int x, int y, int xResolution, int yResolution, int zResolution, float xLL, float yLL, float zStart)
    {
        this.x = x;
        this.y = y;
        this.z = z;
        this.xLL = xLL;
        this.yLL = yLL;
        this.zStart = zStart;
        this.xResolution = xResolution;
        this.yResolution = yResolution;
        this.zResolution = zResolution;
    }

    // Member variable access functions
    public int getX() { return x; }
    public int getY() { return y; }
    public int getZ() { return z; }
    public int getT() { return 0; }
    public float getXLL() { return xLL; }
    public float getYLL() { return yLL; }
    public float getZStart() { return zStart; }
    public int getXResolution() { return xResolution; }
    public int getYResolution() { return yResolution; }
    public int getZResolution() { return zResolution; }

    //Retrieve an element value of a space cube
    //where x, y and z represent the indexes
    public float getElement(int x, int y, int z) {
        if (data != null)
            return data[z][y][x];
        else
            return 0.0f;
    }
    
    public float[][][] getData() { return data; }
    public float getNoData() { return noData; }

    public void putX(int x) { this.x = x; }
    public void putY(int y) { this.y = y; }
    public void putZ(int z) { this.z = z; }
    public void putXLL(float xLL) { this.xLL = xLL; }
    public void putYLL(float yLL) { this.yLL = yLL; }
    public void putZStart(float zStart) { this.zStart = zStart; }
    public void putXResolution(int xResolution) { this.xResolution = xResolution; }
    public void putYResolution(int yResolution) { this.yResolution = yResolution; }
    public void putZResolution(int zResolution) { this.zResolution = zResolution; }
    public void putData(float inputData[][][]) { data = inputData; }
    public void putNoData(float noData) { this.noData = noData; }
    
}
